//
//  FinalViewController.m
//  忘不了
//
//  Created by rimi on 16/7/23.
//  Copyright © 2016年 handuan. All rights reserved.
//

#import "FinalViewController.h"
#import "SDAutoLayout.h"

@interface FinalViewController ()
@property (nonatomic,strong) UIImageView *bgImageView;
@property (nonatomic,strong) UILabel *headingLabel;
@property (nonatomic,strong) UILabel *dateLabel;
@property (nonatomic,strong) UITextView *contentLabel;

@end

@implementation FinalViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self loadUI];
    
}

- (void)loadUI{
    self.view.backgroundColor = [UIColor whiteColor];
    
    _bgImageView = [[UIImageView alloc]init];
    [_bgImageView setImage:[UIImage imageNamed:@"s"]];
    [self.view addSubview:_bgImageView];
    _bgImageView.sd_layout.topSpaceToView(self.view,0).leftSpaceToView(self.view,0).rightSpaceToView(self.view,0).bottomSpaceToView(self.view,0);
    
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [backButton setTitle:@"返回" forState:UIControlStateNormal];
    [backButton setTitleColor:[UIColor brownColor] forState:UIControlStateNormal];
    backButton.backgroundColor = [UIColor clearColor];
    [backButton addTarget:self action:@selector(backButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:backButton];
    backButton.sd_layout.topSpaceToView(self.view,20).leftSpaceToView(self.view,10).widthIs(50).heightIs(30);
    
    _dateLabel = [[UILabel alloc]init];
    if (self.number >= 0) {
        _dateLabel.text = _date;
    }else{
        
    _dateLabel.text = self.dic2[@"data"];
    }
    _dateLabel.font = [UIFont systemFontOfSize:45];
    _dateLabel.textColor = [UIColor colorWithRed:0.6414 green:0.6414 blue:0.6414 alpha:1.0];
    [self.view addSubview:_dateLabel];
    _dateLabel.sd_layout.bottomSpaceToView(self.view,50).leftSpaceToView(self.view,10).rightSpaceToView(self.view,10).heightIs(60);
    
    
    _contentLabel = [[UITextView alloc]init];
    if (self.number >= 0) {
        _contentLabel.text = _content;
    }else{
        
        _contentLabel.text = self.dic2[@"content"];
    }
    _contentLabel.textAlignment = NSTextAlignmentLeft;
    _contentLabel.font = [UIFont systemFontOfSize:26];
    _contentLabel.textColor = [UIColor colorWithRed:0.6414 green:0.6414 blue:0.6414 alpha:1.0];
    _contentLabel.backgroundColor = [UIColor clearColor];
    _contentLabel.editable = NO;
    _contentLabel.showsVerticalScrollIndicator = NO;
    [self.view addSubview:_contentLabel];
    _contentLabel.sd_layout.topSpaceToView(self.view,190).leftSpaceToView(self.view,10).rightSpaceToView(self.view,10).heightIs(self.view.bounds.size.height * 0.6);
    
    _headingLabel = [[UILabel alloc]init];
    if (self.number >= 0) {
        _headingLabel.text = _heading;
    }else{
    
    _headingLabel.text = self.dic2[@"heading"];
    }
    _headingLabel.textAlignment = NSTextAlignmentCenter;
    _headingLabel.font = [UIFont systemFontOfSize:30];
    _headingLabel.textColor = [UIColor colorWithRed:0.6414 green:0.6414 blue:0.6414 alpha:1.0];
    [self.view addSubview:_headingLabel];
    _headingLabel.sd_layout.topSpaceToView(self.view,100).leftSpaceToView(self.view,10).rightSpaceToView(self.view,10).heightIs(60);
    
    
    
}

- (void)backButtonPressed:(UIButton *)sender{
    [self dismissViewControllerAnimated:YES completion:nil];

}



@end
